package com.hboxs.asl.util;

import com.hboxs.asl.Constant;
import com.hboxs.asl.entity.Member;
import com.hboxs.asl.entity.Merchant;
import com.hboxs.asl.service.MerchantService;
import org.springframework.context.ApplicationContext;

import java.math.BigDecimal;

/**
 * Created by difeng JIMO on 2016/05/15.
 */
public class CodeUtils {


    // 产生商家推荐码
    public static String generateCode(Merchant merchant){
        return Constant.MERCHANT_CODE_BEGIN + String.valueOf(merchant.getId()+Constant.MERCHANT_CODE_BASE);
    }

    // 产生主播推荐码
    public static String generateCode(Member member){
        return Constant.MEMBER_CODE_BEGIN + String.valueOf(member.getId()+Constant.MEMBER_CODE_BASE);
    }

}
